﻿/*****************************************************************//**
 *
 * @file   FITKAbaqusINPWriter.h
 * @brief  Abaqus INP 写出， 继承自线程任务。
 * @author fulipeng (flipengqd@yeah.net)
 * @date   2024-03-07
 *
 *********************************************************************/
#ifndef __FITKABAQUSINPWRITER_H__
#define __FITKABAQUSINPWRITER_H__

#include "FITKAbaqusIOINPAPI.h"
#include "FITKAbaqusIOINPInterface.h"
#include "FITK_Kernel/FITKCore/FITKCoreMacros.h"
#include "FITK_Interface/FITKInterfaceIO/FITKAbstractTextWriter.h"

ForwardDeclarNS(Core, FITKAbstractDataObject);

namespace IO
{
    class InpWriteInformationMapper;
    /**
    * @brief Abaqus INP 文件写出器
    * @author fulipeng (fulipengqd@yeah.net)
    * @date 2024-03-07
    */
    class FITKAbaqusIOINPAPI FITKAbaqusINPWriter : public Interface::FITKAbstractTextWriter
    {
    public:
        explicit FITKAbaqusINPWriter();
        virtual ~FITKAbaqusINPWriter();

        /**
         * @brief 重写run函数
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-03-11
         */
        void run() override;

        /**
         * @brief 获取映射表
         * @return InpWriteInformationMapper*
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-07-02
         */
        InpWriteInformationMapper* getWriteInpInformationMapper();

        /**
         * @brief 发送计算进度
         * @param Progress 进度百分比
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-02
         */
        void sendCalculateProgress(int Progress);

        /**
         * @brief 写出每行数据 函数内做每行最大个数限制 循环写出
         * @param strList 多个数据
         * return 返回状态 true 成功 false 失败
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-05-06
         */
        bool writeLineData(QList<QString> strList);

        /**
         * @brief 打印控制台消息
         * @param[i] level 打印级别 1 normal 2 warning 3error
         * @param[i] str 数据
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-04-07
         */
        void consoleMessage(int level, const QString& str) override;

    private:
        /**
         * @brief 映射器
         * @author liuzhonghua (liuzhonghuaszch@163.com)
         * @date 2024-07-02
         */
        InpWriteInformationMapper* _informationWriteInpMapper{};
    };
}



#endif
